package com.gt.wxpay.cashier.domain;

import com.gt.wxpay.cashier.domain.dto.QueryRefundDto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * packageName com.gt.wxpay.cashier.domain
 *
 * @author GuoTong
 * @version JDK 8
 * @className Result
 * @date 2024/3/25
 * @description TODO
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result<T> implements Serializable {
    private boolean success = false;
    private String code;
    private String msg = "";
    private T response = null;

    public static Result error(String message) {
        return new Result(false, "500", message, null);
    }

    public static Result<String> success() {
        return new Result(false, "200", "Success", null);
    }

    public static <T> Result<T> ok() {
        return new Result(false, "200", "Success", null);
    }
}
